package com.geektime.hello.mongo;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @Author: DRevelation
 * @Date: 2021/5/12 9:31
 */
public interface PersonRepository extends MongoRepository<PersonDO, Integer> {

    /**
     *
     * @param username
     * @return
     */
    List<PersonDO> findPersonDOByUsername(String username);

    /**
     * 分页
     * @param username
     * @return
     */
    Page<PersonDO> findPersonDOByUsernameLike(String username, Pageable pageable);
}
